package com.example.lib_base.base.http


/**
 * @author: Albert Li
 * @contact: albertlii@163.com
 * @time: 2021/3/19 8:10 PM
 * @description: 网络请求响应通用类
 * @since: 1.0.0
 */
open class ApiResponse<T>(retcode:Int = -1 ,message: String,messges:String, data: T?) : HttpResponse<T>(retcode, message, messges,data) {

    override fun isSuccess(): Boolean {
        println("------------------ 服务器验证 retcode = ${retcode == 0}")
        return retcode == 0
    }

    override fun getMsg(): String {
        return when{
            !message.isNullOrEmpty() -> message
            !messges.isNullOrEmpty() -> messges
            else->""
        }

    }
}